<h1>ข่าวประชาสัมพันธ์</h1>
<div class="search">
	<form method="get">
		<table class="form">
			<tr><th>หัวข้อ</th><td><input type="text" name="search" value="<?php echo (isset($_GET['search']))?$_GET['search']:'' ?>" /></td><th>หมวดหมู่</th><td><?php echo form_dropdown('category_id',$informations->category->get_option(),@$_GET['category_id'],'','ทั้งหมด') ?></td><td><input type="submit" value="ค้นหา" /></td></tr>
		</table>
	</form>
</div>
<?php echo $informations->pagination()?>
<table class="list">
	<tr>
		<th width="70">แสดง</th>
		<th>เริ่มวันที่</th>
		<th>หัวข้อ</th>
		<th>โดย</th>
		<th>
			<a rel="lightbox" class="btn" href="categories/admin/categories/new_informations?iframe=true&width=90%&height=90%">หมวดหมู่</a>
		</th>
		<th width="90">
			<?php if(permission('informations', 'create')):?>
			<a class="btn" href="new_informations/admin/new_informations/form">เพิ่มรายการ</a>
			<?php endif;?>
		</th>
	</tr>
	<?php foreach($informations as $information): ?>
	<tr <?php echo cycle()?>>
		<td><input type="checkbox" name="status" value="<?php echo $information->id ?>" <?php echo ($information->status=="approve")?'checked="checked"':'' ?> /></td>
		<td><?=DB2Date($information->start_date);?></td>
		<td><?php echo $information->title;?></td>
		<td><?php echo $information->user->display?></td>
		<td><?php echo anchor('new_informations/admin/new_informations?category_id='.$information->category_id,$information->category->name) ?></td>
		<td>
			<?php if(permission('informations', 'update')):?>
			<a class="btn" href="new_informations/admin/new_informations/form/<?php echo $information->id?>" >แก้ไข</a> 
			<?php endif;?>
			<?php if(permission('informations', 'delete')):?>
			<a class="btn" href="new_informations/admin/new_informations/delete/<?php echo $information->id?>" onclick="return confirm('<?php echo lang('notice_confirm_delete');?>')">ลบ</a>
			<?php endif;?>
		</td>
		</tr>
		<?php endforeach; ?>
	</table>
<?php echo $informations->pagination()?>